import { makeAutoObservable } from "mobx";
import { IcommitList, IRootObject } from "@/utils"
import { getanswerList, getCommitList } from "@/services";

class answer {
    constructor() {
        makeAutoObservable(this)
    }
    list: IRootObject = {} as IRootObject
    commitList: IcommitList[] = []
    async getanswerList(answerId: string) {
        let res = await getanswerList(answerId)
        if (res.data) {
            this.list = res.data;
            console.log(this.list);
        }
    }
    async getcommitList(answerId: string) {
        let res = await getCommitList(answerId)
        console.log(res);
        if (res.code == 200) {
            this.commitList = res.rows
        }

    }
    async getUpdataCommit(answerId: string, questionValue: string) {
        let result = await this.getUpdataCommit(answerId, questionValue)
        console.log(result);
        
        

    }

}

export default new answer